package com.example.car.api

import com.example.base.app.conts.BaseConst
import com.example.car.entity.Car
import com.example.car.entity.GetPayCar
import com.example.car.entity.Pay
import com.example.car.entity.PayCar
import com.example.car.entity.PostCar
import com.example.common.view.api.BaseApiServer
import com.example.common.view.model.BaseResultData
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Path

interface CarApiServer:BaseApiServer {
    @GET(BaseConst.GET_CAR_URL)
    suspend fun getCar():BaseResultData<List<Car>>
    @POST(BaseConst.POST_CAR_URL)
    suspend fun postCar(@Body body:RequestBody):BaseResultData<PostCar>
    @POST(BaseConst.PAY_CAR_URL)
    suspend fun payCar(@Body body:PayCar):BaseResultData<Pay>
    @GET(BaseConst.GET_PAY_CAR_URL)
    suspend fun getPayCar(@Path("id")id:Int):BaseResultData<GetPayCar>
}